package com.gitee.wsl.struct.grammar.node.expr.stmt

import com.gitee.wsl.struct.grammar.node.expr.Block
import com.gitee.wsl.struct.grammar.node.expr.IStmt
import com.gitee.wsl.struct.grammar.node.expr.closure.IClosureScope
import com.gitee.wsl.struct.grammar.node.expr.semantic.ISemanticRecorder

/**
 * 【语义分析】块语句
 *
 * @author bajdcc
 */
class StmtBlock : IStmt {

    var block: Block? = null

    override fun analysis(recorder: ISemanticRecorder) {
        block!!.analysis(recorder)
    }

    /*override fun genCode(codegen: ICodegen) {
        block!!.genCode(codegen)
    }*/

    override fun toString(): String {
        return print(StringBuilder())
    }

    override fun print(prefix: StringBuilder): String {
        return prefix.toString() + block!!.print(prefix)
    }

    override fun addClosure(scope: IClosureScope) {

    }
}